CREATE TABLE [dbo].[DnnProduct_PortalLanguages]
(
[PortalLanguageID] [int] NOT NULL IDENTITY(1, 1),
[PortalID] [int] NOT NULL,
[LanguageID] [int] NOT NULL,
[CreatedByUserID] [int] NULL,
[CreatedOnDate] [datetime] NULL,
[LastModifiedByUserID] [int] NULL,
[LastModifiedOnDate] [datetime] NULL,
[IsPublished] [bit] NOT NULL CONSTRAINT [DF_DnnProduct_PortalLanguages_IsPublished] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_PortalLanguages] ADD CONSTRAINT [PK_DnnProduct_PortalLanguages] PRIMARY KEY CLUSTERED  ([PortalLanguageID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_DnnProduct_PortalLanguages] ON [dbo].[DnnProduct_PortalLanguages] ([PortalID], [LanguageID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_PortalLanguages] ADD CONSTRAINT [FK_DnnProduct_PortalLanguages_DnnProduct_PortalLanguages] FOREIGN KEY ([LanguageID]) REFERENCES [dbo].[DnnProduct_Languages] ([LanguageID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[DnnProduct_PortalLanguages] ADD CONSTRAINT [FK_DnnProduct_PortalLanguages_DnnProduct_Portals] FOREIGN KEY ([PortalID]) REFERENCES [dbo].[DnnProduct_Portals] ([PortalID]) ON DELETE CASCADE
GO
